#include <gTest/gTest.h>

#include <vector>
#include <algorithm>

TEST(TestAlgorithm, fill)
{
	using namespace std;
	vector <int> v1;
	vector <int>::iterator Iter1;

	int i;
	for ( i = 0 ; i <= 9 ; i++ )
	{
		v1.push_back( 5 * i );
	}

	cout << "Vector v1 = ( " ;
	for ( Iter1 = v1.begin( ) ; Iter1 != v1.end( ) ; Iter1++ )
		cout << *Iter1 << " ";
	cout << ")" << endl;

	// Fill the last 5 positions with a value of 2
	fill( v1.begin( ) + 5, v1.end( ), 2 );

	cout << "Modified v1 = ( " ;
	for ( Iter1 = v1.begin( ) ; Iter1 != v1.end( ) ; Iter1++ )
		cout << *Iter1 << " ";
	cout << ")" << endl;

}